<?php
namespace App\Event\User;

use App\Event\Event;

// 补贴变动事件
class MoneyFullEvent extends Event
{
    public $user;
    
    public $money;
    
    public $content;
    
    public $type;
    
    // 用户及金额
    public function __construct($user, $money, $content, $type)
    {
        $this->user = $user;
        $this->money = $money;
        $this->content = $content;
        $this->type = $type;
    }
    
    // 日志
    public function log()
    {
        return [
            'type'       => $this->type,
            'money_type' => 'money_full',
            'money'      => $this->money,
            'now'        => $this->user->money_full,
            'content'    => $this->content
        ];
    }
}